import request from '@/utils/request'
import type {AddressAddParamsType, AddressEditParamsType} from "@/types/address";
export default {
    addApi: (data:AddressAddParamsType) => request({
        url: '/api/sumdc.user.address/add',
        method: 'POST',
        data,
        custom: {
            auth: true,
        },
    }),
    editApi: (data:AddressEditParamsType) => request({
        url: '/api/sumdc.user.address/edit',
        method: 'POST',
        data,
        custom: {
            auth: true,
        },
    }),
    indexApi: () => request({
        url: '/api/sumdc.user.address/index',
        method: 'GET',
        custom: {
            auth: true,
        },
    }),
    detailApi: (params:{id:number}) => request({
        url: '/api/sumdc.user.address/detail',
        method: 'GET',
        params,
        custom: {
            auth: true,
        },
    }),
    delApi: (data:{id:number}) => request({
        url: '/api/sumdc.user.address/delete',
        method: 'POST',
        data,
        custom: {
            auth: true,
        },
    }),
    defaultApi: () => request({
        url: '/api/sumdc.user.address/default',
        method: 'GET',
        custom: {
            auth: true,
        },
    }),
}